import { getFieldsMap } from '@/utils/config';

export const getUserColumns = (fields, config = {}) => {
  const userMap = new Map([
    ['staffName', {
      title: '人员名称',
      dataIndex: 'staffName',
      key: 'staffName',
      ...config,
    }],
    ['employeeLevel', {
      title: '员工级别',
      dataIndex: 'employeeLevel',
      key: 'employeeLevel',
      ...config,
    }],
    ['deptName', {
      title: '归属部门',
      dataIndex:'deptName',
      key:'deptName',
      ...config,
    }],
  ]);
  return getFieldsMap(fields, userMap);
};

export const getUserSearchSchema = fields => {
  const userSearchList = new Map([
    ['staffName', {
      field: 'keyword',
      label: '人员名称',
      component: 'Input',
    }],
  ]);
  return getFieldsMap(fields, userSearchList);
};